package gti310.tp3;

import java.util.ArrayList;
import java.util.List;

public class Solutions {

	private ArrayList<Integer[]> solList = new ArrayList<Integer[]>();

	// Add the solution
	public void add(List sol) {
		this.solList.add((Integer[]) sol.toArray(new Integer[1]));
	}

	// Return a nicely formatted string containing every solution.
	public String getSolutionString() {
		Integer[] currentSol;
		String solString = "";
		for (int i = 0; i < solList.size(); i++) {
			currentSol = (Integer[]) solList.get(i);
			for (int g = 0; g < currentSol.length; g++) {
				solString += (currentSol[g] + 1);
				if (g + 1 != currentSol.length) {
					solString += " -> ";
				}
			}
			solString += System.getProperty("line.separator");
			;
		}

		return solString;
	}

}
